/*  This file is part of Real Time Digital Audio Processing library.
 *  Copyright (C) 2008 - Emilio Monti - emilmont@gmail.com
 *
 *  Real Time Digital Audio Processing library is free software: you can
 *  redistribute it and/or modify it under the terms of the GNU General
 *  Public License as published by the Free Software Foundation, either
 *  version 2 of the License, or (at your option) any later version.
 *
 *  Real Time Digital Audio Processing library is distributed in the hope
 *  that it will be useful, but WITHOUT ANY WARRANTY; without even the
 *  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *  See the GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Real Time Audio Processing library.
 *  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef FILTER_H_
#define FILTER_H_

#include "Module.h"

class FIR : Module {
    public:
        FIR(int order, float* coeff);
        void processSignal(float* signal, unsigned long length);
        virtual ~FIR();
    private:
        int order;    /**< Order of the FIR filter */
        float* coeff; /**< Coefficients of the filter @see FIR::processSignal */
        float* w;     /**< Signal buffer */
};

class IIR : Module {
    public:
        IIR(unsigned int sections, float gain, float* coeff);
        void processSignal(float* signal, unsigned long length);
        virtual ~IIR();
    private:
        unsigned int sections; /**< Number of second-order sections */
        float gain;            /**< Gain of the filter*/
        float** c;             /**< Coefficients of the filter @see IIR::processSignal */
        float** w;             /**< Signal buffer */
};

#endif /*FILTER_H_*/
